// pages/page10020/page10020.js
var appInstance = getApp();
Page({
  data:{
    param:'',
  },
  onLoad:function(options){
    this.searchPrdList();
    // 页面初始化 options为页面跳转所带来的参数
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  },
  searchPrdList:function(){
    var that = this;
    var param = appInstance.globalData.session_key;
    var searchPrdList ={
      token :param.myXcxSessionId,
      source:'1', 
      userId:param.userId 
    }
    appInstance.sendRequest({
      url:'/login/getAccountInfo',
      data:searchPrdList,
      method:'POST',
      success: function(res){
        var data = res;
        if(data.memberLevel=='1'){
          data.memberLevel = '普通会员'
        }else if(data.memberLevel=='2'){
          data.memberLevel = 'Vip1'
        }else{
          data.memberLevel = 'Vip3'
        }; 
        that.setData({
          param:data
        }) 
      },
      fail: function(res){
        console.log('getmode fail');
      },
      complete: function(res){
      }
    }) 
  },
  getTopage:function(e){
    var that = this;
    console.log(e);
    var param = e.currentTarget.dataset.op;
    if(param == 'checkmytell'){e
      if(that.data.param.mobile){
        param = '../'+param+'/'+param+'?tel='+that.data.param.mobile
      }
    }else{
      param = '../'+param+'/'+param
    }
   //  

    wx.navigateTo({
      url: param,
      success: function(res){
        // success
      },
      fail: function() {
        // fail
      },
      complete: function() {
        // complete
      }
    })
  }
})